home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Bookshelf 1993 / Microsoft Bookshelf (1993 Edition)(Microsoft Corporation)(CDRM1067820).iso / bin / books93.mst < prev    next >
Text File  |  1993-03-30  |  36KB  |  1,100 lines

  1. '**************************************************************************
  2. '*            Microsoft Multimedia Publishing Group Setup           
  3. '*    Microsoft Bookshelf CD-ROM Reference Library - 1993 Edition
  4. '*       (c) 1993 Microsoft Corporation.  All Rights Reserved.
  5. '************************************************************************
  6.  
  7. ''** disabled $DEFINE DEBUG  ''Define for script development/debugging
  8.  
  9. '$INCLUDE 'setupapi.inc'
  10. '$INCLUDE 'msdetect.inc'
  11.  
  12.  
  13. DECLARE FUNCTION WinExec LIB "kernel" (a$,b%) AS INTEGER
  14. DECLARE FUNCTION GetModuleHandle LIB "kernel" (a$) AS INTEGER 
  15. DECLARE SUB FreeModule             LIB "kernel" (a%) 
  16. DECLARE FUNCTION GetModuleUsage  LIB "kernel" (a%) AS INTEGER
  17.  
  18. DECLARE FUNCTION OpenDriver     LIB "user" (a$, b$, c$) AS INTEGER
  19. DECLARE FUNCTION ExitWindowsExec LIB "user" (a$, b$) AS INTEGER
  20.  
  21. DECLARE FUNCTION AddFontResource LIB "gdi" (a$) AS INTEGER
  22. DECLARE FUNCTION SendMessage LIB "user" (a%,b%,c%,d$) AS INTEGER
  23. DECLARE FUNCTION FindWindow  LIB "user" (a$,b$) AS INTEGER
  24. DECLARE FUNCTION ShowWindow  LIB "user" (a%,b%) AS INTEGER
  25. DECLARE FUNCTION FAsyncAudio LIB "mscuistf.dll"  AS INTEGER  
  26. DECLARE FUNCTION IReplaceTbarBmpsIfDifferent LIB "tbar.dll" (a$,b$,c%) AS INTEGER
  27.  
  28. DECLARE FUNCTION Kill92Group    LIB        "mscuistf.dll"    (a$) AS INTEGER
  29. DECLARE FUNCTION Kill91Group    LIB        "mscuistf.dll"    (a$) AS INTEGER 
  30. DECLARE FUNCTION CheckForCD     LIB        "mscuistf.dll"  (a$) AS INTEGER   
  31. DECLARE SUB     KillViewer    LIB        "mscuistf.dll"    (a$)
  32. DECLARE SUB     KillGroups    LIB        "mscuistf.dll"    ()
  33. DECLARE SUB     UpgradeQkeys    LIB        "mscuistf.dll"    ()
  34.  
  35.  
  36. ''SendMessage() IDs
  37. CONST WM_WININICHANGE  = &H001A
  38. CONST WM_FONTCHANGE    = &H001D
  39. CONST SW_SHOWMINIMIZED = 2
  40.  
  41. ''Dialog ID's
  42.  
  43. CONST WINSPACE        = 2000
  44. CONST WINSPACE_HELP    = 2050
  45.  
  46. CONST WELCOME       = 100
  47. CONST WELCOME_UPGR  = 1200 
  48. CONST INSERT_OLDDISK = 1700
  49. CONST RE_INSERT        = 1900
  50. CONST NO_OLDBOOK    = 1800
  51. CONST HELP_WELCOME  = 2800 
  52. CONST HELP_SYS_CHECK = 3000
  53.  
  54. CONST ASKEXIT        = 200
  55. CONST BOOK_RUNNING  = 1400
  56.  
  57. CONST DESTPATH        = 300
  58. CONST DESTPATH_EXISTING = 305
  59. CONST DESTPATH_HELP    = 350
  60.  
  61. CONST NOLOCALSPACE    = 1000
  62. CONST NOLOCALSPACE_HELP    = 1050
  63.  
  64. CONST INVALID_DIR    = 1100 
  65. CONST INVALID_GROUP = 1130
  66.  
  67. CONST TOOBIG        = 900
  68. CONST TOOBIG_HELP    = 950
  69.  
  70. CONST OPTIONS_1        = 800
  71. CONST OPTIONS_2        = 850
  72.  
  73.  
  74. CONST OPTIONS_BTN1    = 810   '' 'What IS' dialog id
  75. CONST OPTIONS_BTN2    = 820
  76. CONST OPTIONS_BTN3    = 830
  77. CONST OPTIONS_BTN4    = 840
  78.  
  79.  
  80. CONST EXITQUIT        = 600
  81. CONST EXITSUCCESS    = 700
  82. CONST EXITSUCCESS_30    = 750
  83.  
  84. CONST BLBD_REGISTER    = 1300
  85.  
  86. CONST CHECKINGDLG        = 170
  87. CONST SYSCHECK_DLG        = 1120
  88. CONST OLD_BS_EXIST        = 1500
  89. CONST OLD_BS_HELP        = 1170 
  90. CONST KILL_VIEWER        = 1160
  91. CONST EXIT_RESTART        = 2000
  92.  
  93.  
  94. CONST WORD_INI$     = "Microsoft Word 2.0"
  95. CONST BOOK_INI$     = "Bookshelf"
  96. CONST PROG_GRP$     = "Bookshelf - 1993"
  97.  
  98. CONST CHECK_QK        = 1
  99. CONST MULTI_ICON    = 1
  100. CONST CHECK_WW        = 2 
  101. CONST EW_RESTARTWINDOWS    = 66       
  102.  
  103.  
  104. ' ALL UPGRADE DIALOG ID
  105. ' ---------------------
  106. CONST    UPG_1        = 2700
  107. CONST    HELP_UPG_1    = 2900
  108. CONST    UPG_2        = 2600
  109.  
  110.  
  111. '' Size of how much space will be needed to instal base files.
  112. '' These estimates assuming 4k sector size on disk.
  113. CONST WIN_SIZE_K= 544
  114. CONST WIN_SIZE    = 544000
  115. CONST WORD_SIZE = 180000
  116. CONST BS_SIZE    = 900000
  117. CONST TOT_SIZE    = WIN_SIZE + WORD_SIZE + BS_SIZE
  118.  
  119. ''Bitmap ID
  120. CONST LOGO = 1
  121.  
  122. GLOBAL SRCDIR$      '' CD root path (location of setup.exe)
  123. GLOBAL WININI$      '' Fully-qualified path to WIN.INI
  124. GLOBAL DEST$        '' Default destination directory.
  125. GLOBAL BookDir$    '' Default destination directory.
  126. GLOBAL WordDir$     '' Location of Winword.exe
  127. GLOBAL VIEWINI$        '' full pat to viewer.ini (in windows directory)   
  128.  
  129. GLOBAL fKillView91%
  130. GLOBAL fKillView92%
  131.  
  132.  
  133. '**************************************************************************
  134. '**************************************************************************
  135. '**
  136. '**  Multimedia Publishing Group - Setup Script
  137. '**
  138. '**  Modify the following DEFINES and routines to customize setup
  139. '**    for a specific product
  140. '**
  141. '**************************************************************************
  142. '**************************************************************************
  143. DECLARE SUB Install        '' Modify for specific runtimes
  144. DECLARE SUB InstallFonts    '' Modify for custom fonts
  145. DECLARE SUB CreateProgMan    '' Modify for Program Groups/Items
  146. DECLARE SUB InstallQuicKeys    '' Install quickeys.
  147. DECLARE SUB InstallWinWord    '' Set DEFINE to enable/disable
  148.  
  149. DECLARE SUB UpdateQuicKeys (szInifile$ , szOldBook$, szNewBook$, szDefault$)
  150. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING  
  151. DECLARE SUB RemoveViewer(szPath$) ' ask to remove viewer files
  152.  
  153.  
  154. '**************************************************************************
  155. '**************************************************************************
  156.  
  157. '**************************************************************************
  158. '**  General Installation Script
  159. '**************************************************************************
  160. INIT:
  161.     '' maximize window
  162.     i% = FindWindow ("Stuff-Shell","Setup")
  163.     IF i%<>0 THEN
  164.         i% = ShowWindow (i%, 3)
  165.     ELSE
  166.         i% = DoMsgBox ("I am a stud!","setup message",0)
  167.     ENDIF
  168.  
  169.     CUIDLL$ = "mscuistf.dll"        ''Custom user interface dll
  170.     HELPPROC$ = "FHelpDlgProc"        ''Help dialog procedure
  171.  
  172.     NL$ = Chr$(13) + Chr$(10)        '' Define newline
  173.     TAB$ = Chr$(9)                    '' Define a tab
  174.  
  175.  
  176.     '' Use bad exit as default untill you've done a clean setup
  177.     dlg_EXIT% = EXITQUIT
  178.  
  179.     SetBitmap CUIDLL$, LOGO
  180.     SetTitle "Setup for " + PROG_GRP$
  181.  
  182.     SRCDIR$ = GetSymbolValue("STF_SRCDIR")
  183.     WININI$ = MakePath(GetWindowsDir(),"WIN.INI")
  184.     VIEWINI$ = MakePath(GetWindowsDir(), "VIEWER.INI")
  185.     SPLITPATH SRCDIR$,DRIVE$,PATH$,FILENAME$,EXT$
  186.     
  187.  
  188.     ' IF VIEWER IS RUNNING ASK USER TO QUIT IT FIRST
  189.     ' ALSO DO THE SAME FOR WORD (THAT'S OK, BETTER WAY IS TO WAIT UNTIL USER WANT TO 
  190.     ' INTEGRATE WORD TO BOOKSHELF. BUT THIS IS NO BIG DEAL.)
  191.     ' ------------------------------------------------------------------------------
  192.      ''  Find out if we can integrate with WinWord 2.0.
  193.     ''  Find out if the Winword 2.0 section is in win.ini and if
  194.     ''  the key 'programdir' point to a valid dir and it isn't a on a
  195.     ''  network drive, we aren't going to support integrating with
  196.     ''  network versions of Winword.
  197.     '' fWW% will be set to 0 if there is no valid version of Winword 2.0.
  198.  
  199.     fWW% = 0
  200.      IF ( DoesIniSectionExist(WININI$, WORD_INI$) <> 0) THEN
  201.         WordDir$ = GetIniKeyString(WININI$, WORD_INI$, "programdir")
  202.         IF WordDir$ <> "" THEN
  203.             SPLITPATH WordDir$,DRIVE$,PATH$,FILENAME$,EXT$
  204.             IF (IsDriveNetwork(DRIVE$) <> 1) AND (DoesFileExist(MakePath(WordDir$,"WINWORD.EXE"),femExists) = 1) THEN
  205.                 fWW% = 1
  206.             ENDIF
  207.         ENDIF
  208.     ENDIF
  209.  
  210.     fMVrunning% = GetModuleHandle("MVAPI")        ' check for viewer doesn't seem to work
  211.     fMV2running% = GetModuleHandle("MVAPI2")
  212.  
  213.      '' fWWrunning% will be set to 0 if it isn't Winword isn't currently
  214.     '' running or if fWW% is 0.
  215.     IF fWW% <> 0 THEN
  216.         fWWrunning% = GetModuleHandle("MSWORD")
  217.     ELSE
  218.         fWWrunning% = 0
  219.     ENDIF
  220.  
  221.  
  222.  
  223.     IF  (fMVrunning% <> 0) or (fMV2running% <> 0) THEN
  224.         AreRunning$ = "Setup has detected active Multimedia applications or an old version of QuicKeys."
  225.  
  226.         AreRunning$ = AreRunning$ + NL$ + "Please close these applications, and run Setup again." + NL$
  227.  
  228.         i% = DoMsgBox(AreRunning$ , "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  229.  
  230.         END  '' Exit Setup
  231.     ENDIF
  232.  
  233.  
  234.     IF (fWWrunning% <> 0) THEN
  235.         AreRunning$ = "Setup must update or change files used by Microsoft Word:" + NL$
  236.  
  237.         AreRunning$ = AreRunning$ + NL$ + "Please close this application and run Setup again." + NL$
  238.  
  239.         i% = DoMsgBox(AreRunning$ , "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  240.  
  241.         END  '' Exit Setup
  242.     ENDIF
  243.  
  244.     ' CHECK TO DISK SPACE
  245.     ' -------------------
  246.     BookDir$ = MAKEPATH( SRCDIR$ , "BOOKS\")
  247.  
  248.     '' Read in file list from BOOKS93.inf
  249.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  250.     IF szInf$ = "" THEN
  251.         szInf$ = GetSymbolValue("STF_CWDDIR") + "BOOKS93.INF"
  252.     END IF
  253.     ReadInfFile szInf$
  254.  
  255.     '' Add the files that will always be needed for the windows directory
  256.     ''   so that we can find out if there is enough space to install on
  257.     ''   the windows dir.
  258.  
  259. ' NOTE: (ung)
  260. ' ----
  261. '    SHOULD CHECK ALL COPY COST LATER AFTER WE GET ALL THE FILES NEEDED TO COPY
  262. '   --------------------------------------------------------------------------
  263. '   --------------------------------------------------------------------------
  264. '    AddSectionFilesToCopyList "BS93Sys", SRCDIR$, GetWindowsSysDir$
  265.  
  266. '    IF GetCopyListCost("","","") <> 0 THEN
  267. '        SPLITPATH GetWindowsSysDir$,DRIVE$,PATH$,FILENAME$,EXT$
  268. '        '' Fill in the Dialogue box
  269. '        sz$ = "There is not enough space on the " + DRIVE$ + " drive to install Bookshelf." + NL$
  270. '        sz$ = sz$ + "Setup must install some files in the Windows directory on this drive." + NL$
  271. '        sz$ = sz$ + "Please remove some files to free " + Str$(WIN_SIZE_K) + "K of space, then run Setup again."
  272.  
  273. '        i% = DoMsgBox(sz$ , "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  274. '        UIPopAll
  275. '        END '' Exit Setup
  276. '    ENDIF    
  277.     
  278.     ' WHEN WE GET ALL CHECKS ARE OK ( WIN VER, VIEWER NOT RUUNING, DISK SPACE OK)
  279.     ' ---------------------------------------------------------------------------    
  280.     ' remove some dll for viewer ( this should be viewer job) 
  281.     
  282.     hModule% = GetModuleHandle("MVBRKR2")
  283.     IF hModule% <>0 THEN
  284.         WHILE GetModuleUsage(hModule%) > 1
  285.             FreeModule(hModule%)
  286.         WEND
  287.         FreeModule(hModule%)
  288.     ENDIF
  289.  
  290. WELCOME:
  291.     ' Check for upgrate installation. If it is an upgrade setup, check for a file in the 
  292.     ' books directory depending on the year. If the file exists we do the normal installation
  293.     ' else inform the user the fact and quit(NO MERCY!). 
  294.     '----------------------------------------------------------------------------------------
  295.     upgrade = 0
  296.     IF (DoesFileExist(SRCDIR$+"bin\upgrade.txt", cmoNone)<>0)THEN
  297.         upgrade = 1 
  298.         i% =0                                   
  299.  
  300.         sz$ = UIStartDlg(CUIDLL$, WELCOME_UPGR, "FInfoDlgProc", HELP_WELCOME, HELPPROC$)
  301.         IF sz$="CONTINUE" THEN 
  302.             UIPop 1
  303.             ' Check for old bookshelf
  304.             ' -----------------------
  305.    NEXTTRY:
  306.             sz$ = UIStartDlg(CUIDLL$, UPG_1, "FInfoDlgProc", HELP_UPG_1, HELPPROC$)
  307.             UIPop 1
  308.             IF sz$="CONTINUE" THEN
  309.                 IF(DoesFileExist(SRCDIR$+"books\cce.db",cmoNone)<>0)THEN    'Sony 1991    
  310.                     GOTO ITEXISTS 
  311.                 ELSEIF(DoesFileExist(SRCDIR$+"books\bks92.ind", cmoNone) <> 0)THEN    'word bun92 and bookshelf 92
  312.                     GOTO ITEXISTS
  313.                 ELSEIF(DoesFileExist(SRCDIR$+"books\books.ind", cmoNone) <> 0)THEN    'bookshelf 91
  314.                     GOTO ITEXISTS
  315.                 ELSEIF(DoesFileExist(SRCDIR$+"book\world87.db", cmoNone) <> 0)THEN    'bookshelf 87 dos
  316.                     GOTO ITEXISTS
  317.                 ELSE
  318.                     i% = i%+1
  319.                     IF (i% < 3)THEN 
  320.                         GOTO NEXTTRY    ' allow 3 times to try 
  321.                     ENDIF
  322.                     sz$=UIStartDlg(CUIDLL$, NO_OLDBOOK,"FInfoDlgProc",HELP_UPG_1,HELPPROC$)
  323.                     GOTO QUIT
  324.                     END
  325.                 ENDIF
  326.                 
  327.             ELSE
  328.                 GOSUB ASKEXIT
  329.                 GOTO WELCOME
  330.             ENDIF
  331.             
  332.         ELSE 
  333.             GOSUB ASKEXIT
  334.             GOTO WELCOME
  335.         ENDIF 
  336.     ELSE 'Full installation
  337.         sz$ = UIStartDlg("mscuistf.dll", WELCOME, "FInfoDlgProc", HELP_WELCOME, HELPPROC$)
  338.         IF sz$ = "CONTINUE" THEN
  339.             UIPop 1
  340.         ELSE
  341.             GOSUB ASKEXIT
  342.             GOTO WELCOME
  343.         END IF 
  344.     ENDIF
  345.                      
  346. ITEXISTS:
  347. ' Ask her to reinsert the disk if upgrade = 1
  348. ' ----------------------------
  349.     IF upgrade = 0 THEN
  350.         GOTO ALLSET
  351.     ENDIF
  352.     
  353.     sz$= UIStartDlg(CUIDLL$, UPG_2, "FInfoDlgProc", 0, "")
  354.     UIPop 1
  355.     IF sz$ = "CONTINUE" THEN
  356.         IF(DoesFileExist(SRCDIR$+"books\books93.mvb",cmoNone)<>0)THEN 
  357.             
  358.             GOTO ALLSET
  359.         ELSE
  360.             GOTO ITEXISTS
  361.         ENDIF
  362.                 
  363.     ELSEIF sz$="HELP" THEN
  364.     ELSE
  365.         GOSUB ASKEXIT
  366.         GOTO ITEXISTS
  367.     ENDIF
  368.  
  369. ALLSET:               
  370. '' Checking for existing  bookshelf (91 & 92)
  371. ''
  372.     OptionsGreyed$ = "OptionsGreyed"
  373.     CheckItemsIn$ = "CheckItemsIn"
  374.  
  375.     AddListItem CheckItemsIn$, "OFF"
  376.     AddListItem CheckItemsIn$, "OFF"      
  377.     bookExist% = 0 
  378.     
  379.     i% = DoesIniSectionExist(VIEWINI$, "WA91")
  380.  
  381.     IF i%=0 THEN
  382.         AddListItem OptionsGreyed$, "0"
  383.     ELSE               
  384.         AddListItem OptionsGreyed$, "1"
  385.         bookExist% = 1 
  386.     ENDIF
  387.      
  388.     ' CHECK FOR BOOK 92
  389.     ' -----------------
  390.     i% = DoesIniSectionExist(VIEWINI$, "WA92")
  391.     IF i% = 0 THEN  
  392.         AddListItem OptionsGreyed$, "0"
  393.     ELSE                               
  394.         AddListItem OptionsGreyed$, "1"
  395.         bookExist% = bookExist% + 1
  396.     ENDIF
  397.     
  398.     IF  bookExist% > 0 THEN
  399. OLDEXIST:
  400.         sz$=UIStartDlg(CUIDLL$, OLD_BS_EXIST, "FCheckDlgProc",OLD_BS_HELP, HELPPROC$)
  401.         IF sz$ = "CONTINUE" THEN
  402.             UIPop 1
  403.         ELSEIF sz$ = "EXIT" THEN
  404.             GOSUB ASKEXIT
  405.             GOTO OLDEXIST
  406.         ELSEIF sz$ = "REACTIVATE" THEN
  407.             GOTO OLDEXIST  
  408.         ELSE
  409.             GOTO OLDEXIST
  410.         ENDIF 
  411.     ENDIF                                                
  412.  
  413. GETPATH:
  414. '**
  415. '** 'Search for disk space.
  416. '**
  417.  
  418.         LocalDrives$ = "LocalDrives"
  419.  
  420.         GetLocalHardDrivesList LocalDrives$
  421.         n% = GetListLength(LocalDrives$)
  422.  
  423.         FOR i% = 1 TO n% STEP 1
  424.             DRIVE$ = GetListItem(LocalDrives$,i%)
  425.             Size& = GetFreeSpaceForDrive(DRIVE$)
  426.             IF Size& > BS_SIZE THEN
  427.                 Dest_Drive$ = DRIVE$
  428.                 GOTO FOUND_SPACE
  429.             ENDIF
  430.         NEXT i%
  431.  
  432.         '' Couldn't find any local Hard Drive with enough
  433.         ''   space for instaling bookshelf.
  434.         Dest_Drive$ = "C"
  435. NOSPACE:
  436.         sz$ = UIStartDlg(CUIDLL$, NOLOCALSPACE , "FEditDlgProc", NOLOCALSPACE_HELP, HELPPROC$)
  437.  
  438.         '' They want to continue anyway.
  439.         IF sz$ = "CONTINUE" THEN
  440.             UIPop 1
  441.             GOTO FOUND_SPACE
  442.         ELSEIF sz$ = "REACTIVATE" THEN
  443.             GOTO NOSPACE
  444.         ELSE
  445.             GOSUB ASKEXIT
  446.             GOTO NOSPACE
  447.         END IF
  448.  
  449. FOUND_SPACE:
  450.         DEST$ = Dest_Drive$ + ":\BSHELF93"
  451.         DLG_VIEWER% = DESTPATH
  452.  
  453. ' ***
  454. ' *** Do CDTest and system check
  455. ' ***    
  456.  
  457.     '' See if we install from the network drive
  458.     szSrcDir$ = GetSymbolValue("STF_SRCDIR")
  459.     szSrcDrv$ = Mid$(szSrcDir$, 1, 1)
  460.  
  461.     IF (IsDriveNetwork (szSrcDrv$) = 1) AND (CheckForCD(szSrcDrv$) = 0) THEN
  462.     SetSymbolValue "szNetDrive", "1"
  463.     SetSymbolValue "testpath",   "NETWORK"
  464.     ELSE
  465.     SetSymbolValue "szNetDrive", "0"
  466.     SetSymbolValue "testpath",   MAKEPATH(SRCDIR$,"BOOKS\MM\T006838A.WAV")
  467.     ENDIF
  468.  
  469.  
  470.     sz$ = UIStartDlg(CUIDLL$, CHECKINGDLG, "CheckingDlgProc", 0, "")
  471.  
  472.  
  473. SYSCHECK:
  474.  
  475.     sz$ = UIStartDlg(CUIDLL$, SYSCHECK_DLG, "SysCheckDlgProc",HELP_SYS_CHECK,HELPPROC$)
  476.     
  477.     IF sz$ = "CONTINUE" THEN
  478.         RemoveSymbol "szNetDrive"
  479.         UIPop 2
  480.     ELSEIF sz$ = "EXIT" THEN
  481.         GOSUB ASKEXIT
  482.         GOTO SYSCHECK 
  483.     ELSEIF sz$ = "REACTIVATE" THEN
  484.         GOTO SYSCHECK 
  485.         
  486.     ELSE
  487.         dlg_WHAT_IS% = Val(sz$)
  488.         sb$=GetSymbolValue ("bStatus")
  489.         IF sb$ = "ok" THEN
  490.             dlg_WHAT_IS% = dlg_WHAT_IS%+1000    
  491.         ELSEIF sb$ = "warning" THEN
  492.             dlg_WHAT_IS% = dlg_WHAT_IS%+2000
  493.         ELSE
  494.             dlg_WHAT_IS% = dlg_WHAT_IS%+3000
  495.         ENDIF
  496.         GOSUB WHAT_IS
  497.         GOTO SYSCHECK
  498.     ENDIF
  499.  
  500.     '' All system hardware    test is fine when we get here.
  501.     '' Prompt the user for options.
  502.  
  503.     
  504.         '' Initialize dlg box
  505.  
  506.         CheckItemsState$ = "CheckItemsState"
  507.         AddListItem CheckItemsState$, "OFF"        '' set multiple icons to off
  508.  
  509.         dlg% = OPTIONS_1
  510.  
  511.         IF fWW% <> 0 THEN        '' need to integrate Word
  512.             dlg% = OPTIONS_2
  513.             AddListItem CheckItemsState$, "ON"    '' for Word for Windows check box
  514.         END IF
  515.         
  516.         '' Set the path edit text box
  517.        
  518.            sz$=GetIniKeyString(VIEWINI$, "files", "BOOKS93.dll")
  519.            IF sz$ <> "" THEN
  520.                pos% = instr(sz$,",")
  521.                IF pos%<>0 THEN
  522.                    sz$ = mid$(sz$,1,pos%-1)
  523.                ENDIF
  524.                SetSymbolValue "EditTextIn", sz$    
  525.            ELSE
  526.             SetSymbolValue "EditTextIn", DEST$  
  527.         ENDIF
  528.         SetSymbolValue "EditFocus", "END"
  529.         
  530. ''////////////////////// 
  531. OPTIONS:
  532.         sz$ = UIStartDlg(CUIDLL$, dlg% , "FCustInstDlgProc", 0, "")
  533.         DEST$ = GetSymbolValue("EditTextOut")
  534.  
  535.         IF sz$ = "CONTINUE" THEN 
  536.         
  537.             IF IsDirWritable(DEST$) = 0 THEN
  538.                  dlg_WHAT_IS% = INVALID_DIR
  539.                  GOSUB WHAT_IS
  540.                  GOTO OPTIONS  
  541.             ELSE 
  542.                 gr$=GetSymbolValue("groupName")
  543.                 gr$ = LTRIM$(gr$)
  544.                 gr$ = RTRIM$(gr$)
  545.                 IF gr$ = "" THEN
  546.                     dlg_WHAT_IS% = INVALID_GROUP    
  547.                     GOSUB WHAT_IS
  548.                     GOTO OPTIONS
  549.                 ENDIF
  550.             ENDIF
  551.             
  552.  
  553.             ''    Find out if there is enough disk space.
  554.             
  555.             Prev% = ShowWaitCursor()
  556.  
  557.             AddSectionFilesToCopyList "BS93Sys", SRCDIR$, GetWindowsSysDir$
  558.             AddSectionFilesToCopyList "Bookshelf", SRCDIR$, DEST$
  559.             AddSectionFilesToCopyList "BooksDir", BookDir$, DEST$ 
  560.             AddSectionFilesToCopyList "BS93Win", SRCDIR$, GetWindowsDir()
  561.         
  562.             ' We decided co copy all viewer stuffs to \windows\system 3/4/93
  563.             ' ------------------------------------------------------------- 
  564.             AddSectionFilesToCopyList "Viewer", SRCDIR$, GetWindowsSysDir()
  565.                                                                       
  566.             '' Add multiple icons if the user select multiple
  567.             '' books for bookshelf
  568.             ''
  569.             sz$ = GetListItem(CheckItemsState$, MULTI_ICON)
  570.             IF sz$ = "ON" THEN  
  571.                 AddSectionFilesToCopyList "MultiIcons", BookDir$, DEST$
  572.             ENDIF                                 
  573.  
  574.             IF GetCopyListCost("","","") <> 0 THEN
  575.                 RestoreCursor Prev%
  576.  
  577.                 '' Not enough space
  578.                 sz$ = UIStartDlg(CUIDLL$, TOOBIG , "FInfoDlgProc", 0, "")
  579.         
  580.                 IF sz$ <> "BACK" THEN
  581.                     GOSUB ASKEXIT
  582.                 ENDIF
  583.  
  584.                 '' clear list and put back the windows files
  585.  
  586.                 ClearCopyList
  587.                 UIPop 1
  588.                 GOTO OPTIONS
  589.             ENDIF
  590.  
  591.             '' Find out if we there is enough space to prompt for the WinWord 2.0
  592.             ''  integration.
  593.  
  594.             RestoreCursor Prev%
  595.             UIPop 1
  596.  
  597.         ELSEIF sz$ = "REACTIVATE" THEN
  598.             GOTO OPTIONS
  599.  
  600.         ELSEIF sz$ = "BTN1" THEN
  601.             dlg_WHAT_IS% = OPTIONS_BTN1
  602.             GOSUB WHAT_IS
  603.             GOTO OPTIONS
  604.  
  605.         ELSEIF sz$ = "BTN2" THEN            '' help for integrating word 
  606.             dlg_WHAT_IS% = OPTIONS_BTN2
  607.             GOSUB WHAT_IS
  608.             GOTO OPTIONS
  609.  
  610.         ELSEIF sz$ = "BTN3" THEN            '' help for program group
  611.             dlg_WHAT_IS% = OPTIONS_BTN3
  612.             GOSUB WHAT_IS
  613.             GOTO OPTIONS
  614.  
  615.         ELSEIF sz$ = "BTN4" THEN
  616.             dlg_WHAT_IS% = OPTIONS_BTN4
  617.             GOSUB WHAT_IS
  618.             GOTO OPTIONS
  619.  
  620.         ELSEIF sz$ = "CHK1" THEN        '' Multiple icons for bookshelf
  621.             sz$ = GetListItem(CheckItemsState$, CHECK_QK)
  622.             IF sz$ = "ON" THEN
  623.                 ReplaceListItem CheckItemsState$, CHECK_QK, "OFF"
  624.             ELSEIF sz$ = "OFF" THEN
  625.                 ReplaceListItem CheckItemsState$, CHECK_QK, "ON"
  626.             ENDIF
  627.             GOTO OPTIONS
  628.  
  629.         ELSEIF sz$ = "CHK2" THEN
  630.             sz$ = GetListItem(CheckItemsState$, CHECK_WW)
  631.             IF sz$ = "ON" THEN
  632.                 ReplaceListItem CheckItemsState$, CHECK_WW, "OFF"
  633.             ELSEIF sz$ = "OFF" THEN
  634.                 ReplaceListItem CheckItemsState$, CHECK_WW, "ON"
  635.             ENDIF
  636.             GOTO OPTIONS
  637.  
  638.         ELSE '' Exit, Cancel, or unknown button
  639.             GOSUB ASKEXIT
  640.             GOTO OPTIONS
  641.         END IF
  642.  
  643.         '' Find out if they want winword integration
  644.         '' and multiple icons
  645.         
  646.         IF fWW% <> 0 THEN
  647.             sz$ = GetListItem(CheckItemsState$, CHECK_WW)
  648.             IF sz$ <> "ON" THEN
  649.                 fWW% = 0
  650.             ELSE
  651.                 fWW% = 1
  652.                 AddSectionFilesToCopyList "BS93Word", SRCDIR$, WordDir$
  653.                 AddSectionFilesToCopyList "BS93WordWin", SRCDIR$, GetWindowsDir()
  654.                 AddSectionFilesToCopyList "BS93WordSys", SRCDIR$, GetWindowsSysDir()
  655.             ENDIF
  656.         ENDIF
  657.  
  658. '**********************************************
  659. '****                                    ******
  660. '****    CLEAN UP OLD BOOKS 91 and 92    ******
  661. '****                                    ******
  662. '**********************************************                                                                 
  663. '
  664.     i% = GetListLength("CheckItemsOut")
  665.  
  666.     UpgradeQkeys
  667.     IF i% > 0 THEN
  668.         files$ = "files"
  669.         sz$ = GetListItem("CheckItemsOut",1)
  670.         IF sz$ = "ON" THEN    '' delete the 1991 book
  671.             
  672.             ' DELETE DIRECTORY
  673.             ' ---------------- 
  674.             
  675.             '' Remove all the 92 [section] in view.ini
  676.             '' ---------------------------------------
  677.             RemoveIniSection VIEWINI$, "Cquote", cmoOverwrite
  678.             RemoveIniSection VIEWINI$, "bquote", cmoOverwrite
  679.             RemoveIniSection VIEWINI$, "WA91", cmoOverwrite
  680.             RemoveIniSection VIEWINI$, "Encyc", cmoOverwrite
  681.             RemoveIniSection VIEWINI$, "Roget", cmoOverwrite
  682.             RemoveIniSection VIEWINI$, "Dict", cmoOverwrite
  683.             RemoveIniSection VIEWINI$, "Atlas", cmoOverwrite
  684.             RemoveIniSection VIEWINI$, "Books", cmoOverwrite
  685.             load$=GetIniKeyString(WININI$, "windows", "load") 
  686.  
  687.             IF load$ <> "" THEN
  688.                 load$ = UCASE$(load$)
  689.                 i% = INSTR(load$,"QUICKEYS")
  690.                 n% = 0
  691.                 IF i% <> 0 THEN   
  692.                     FOR j% = i% TO 1 STEP -1 
  693.                         n% = n%+1
  694.                         IF mid$(load$,j%,1) = " " THEN 
  695.                             GOTO FOUND
  696.                         ENDIF 
  697.                     NEXT j%                                                   
  698.         FOUND:
  699.                     IF j% = 0 THEN
  700.                         j%=1
  701.                     ENDIF
  702.                     
  703.                     dir$=MID$(load$, j%, n%-2)
  704. '                    k%=DoMsgBox("dir",dir$,MB_OK) 
  705.                     fKillView91% = Kill91Group(dir$) 'flag to delete viewer 91
  706.                     IF j% > 1 THEN   
  707.                         newLoad$ = MID$(load$, 1, j%-1)
  708.                     ENDIF
  709.                     newLoad$= newLoad$+MID$(load$, i%+12, LEN(load$))  
  710.                     CreateIniKeyValue WININI$, "windows", "load", newLoad$, cmoOverwrite 
  711.                 ENDIF
  712.             ENDIF
  713.         ENDIF
  714.         
  715.         sz$ = GetListItem("CheckItemsOut",2)
  716.         IF sz$ = "ON" THEN    '' delete the 1992 book 
  717.             
  718.             ' REMOVE KEYSTRINGS
  719.             ' ----------------                              
  720.             RemoveIniKey VIEWINI$, files$, "Cquote92.MVB", cmoOverwrite
  721.             RemoveIniKey VIEWINI$, files$, "BQuote92.MVB", cmoOverwrite
  722.             RemoveIniKey VIEWINI$, files$, "WA92.MVB", cmoOverwrite
  723.             RemoveIniKey VIEWINI$, files$, "Encyc92.MVB", cmoOverwrite
  724.             RemoveIniKey VIEWINI$, files$, "Roget92.MVB", cmoOverwrite
  725.             RemoveIniKey VIEWINI$, files$, "Dict92.MVB", cmoOverwrite
  726.             RemoveIniKey VIEWINI$, files$, "Atlas92.MVB", cmoOverwrite
  727.             RemoveIniKey VIEWINI$, files$, "Books92.MVB", cmoOverwrite 
  728.             
  729.             ' REMOVE SECTIONS
  730.             ' ---------------
  731.             RemoveIniSection VIEWINI$, "Cquote92", cmoOverwrite
  732.             RemoveIniSection VIEWINI$, "bquote92", cmoOverwrite
  733.             RemoveIniSection VIEWINI$, "WA92", cmoOverwrite
  734.             RemoveIniSection VIEWINI$, "Encyc92", cmoOverwrite
  735.             RemoveIniSection VIEWINI$, "Roget92", cmoOverwrite
  736.             RemoveIniSection VIEWINI$, "Dict92", cmoOverwrite
  737.             RemoveIniSection VIEWINI$, "Atlas92", cmoOverwrite
  738.             RemoveIniSection VIEWINI$, "Books92", cmoOverwrite 
  739.  
  740.             ' Kill the program group and delete files
  741.             ' ---------------------------------------
  742.             szPath$ = GetIniKeyString(WININI$, "multimedia viewer", "ViewerPath")
  743.             fKillView92%=Kill92Group(szPath$)
  744.         ENDIF
  745.  
  746. ' ****************************************************************************
  747. ' *** Delete Viewer. Present a dialog with the checkbox and ask if the user 
  748. ' *** want to delete the viewer files.
  749. ' ***
  750. ' ****************************************************************************                  
  751.     
  752.         IF fKillView91%=1 or fKillView92%=1 THEN
  753.             RemoveSymbol "OptionsGreyed"
  754.             RemoveSymbol "CkeckItemsIn"
  755.  
  756.             AddListItem "CkeckItemsIn", "ON"
  757. DELVIEWER:
  758.             sz$=UIStartDlg("mscuistf.dll", KILL_VIEWER, "FCheckDlgProc", 0, "")
  759.             IF sz$ = "CONTINUE" THEN
  760.                 UIPop 1
  761.                 check$ = GetListItem ("CheckItemsOut",1)
  762.                 IF check$ = "ON" THEN 
  763.                     KillViewer(szPath$)
  764.                 ENDIF
  765.             ELSEIF sz$ = "EXIT" THEN
  766.                 UIPop 1
  767.                 GOSUB ASKEXIT
  768.                 GOTO DELVIEWER
  769.             ELSE
  770.                 GOTO DELVIEWER
  771.             ENDIF
  772.         ENDIF
  773.     ENDIF
  774.     '' Kill the progman groups
  775.     KillGroups
  776.     '' Check if msacm is loaded.
  777.     sz$ = GetIniKeyString(MAKEPATH(GetWindowsDir(),"system.ini"),"drivers","wavemapper")
  778.     sz$ = UCASE$(sz$)
  779.     fMsacmNew% = INSTR(sz$,"MSACM")
  780.  
  781.     SetRestartDir DEST$
  782.     Install                
  783.  
  784.     IF fWW% = 1 THEN
  785.         fWWrunning% = GetModuleHandle("MSWORD")
  786.         WHILE fWWrunning% <> 0
  787.             AreRunning$ = "Setup must update or change some of the files used by Microsoft Word" + NL$
  788.             AreRunning$ = AreRunning$ + NL$ + "Please Quit Microsoft Word and press OK"
  789.             i% = DoMsgBox(AreRunning$ , "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  790.             fWWrunning% = GetModuleHandle("MSWORD")
  791.         WEND
  792.         InstallWinWord
  793.     ENDIF
  794.  
  795.  
  796. ''*****************************************************************
  797.  
  798.     IF (RestartListEmpty()=1) AND (fMsacmNew%<>0) THEN
  799.     dlg_EXIT% = EXITSUCCESS
  800.     '' Load qkeys.
  801.     i% = OpenDriver ("QKeys","drivers","")
  802.     ELSE
  803.     dlg_EXIT% = EXIT_RESTART
  804.     ENDIF
  805.      
  806. QUIT:' this is where we 'magically' come when user cancel during file copy    
  807.  
  808.     ON ERROR GOTO ERRQUIT
  809.     
  810.     UIPopALL
  811.     sz$ = UIStartDlg(CUIDLL$, dlg_EXIT%, "FinfoDlgProc", 0, "")
  812.     IF sz$ = "REACTIVATE" THEN 
  813.         GOTO QUIT
  814.     ELSEIF sz$ = "EXIT" THEN
  815.     if (RestartListEmpty()=1) THEN
  816.         sz$ = "WARNING: To take full advantage of Bookshelf features, you must restart windows.  Restart Windows now?"
  817.         i% = DoMsgBox (sz$,"Setup Message",4)
  818.         if i% = 6 THEN
  819.         i% = ExitWindowsExec (MAKEPATH(DEST$,"_msrstrt.exe"),"")
  820.         GOTO QUIT
  821.         ENDIF
  822.         END
  823.     ELSE
  824.         GOSUB ASKEXIT
  825.         GOTO  QUIT
  826.     ENDIF
  827.     ELSEIF sz$ = "CONTINUE" THEN  ' Restart windows  
  828.     IF dlg_EXIT% = EXIT_RESTART THEN
  829.         ''i% = ExitExecRestart()
  830.         i% = ExitWindowsExec (MAKEPATH(DEST$,"_msrstrt.exe"),"")
  831.         GOTO QUIT
  832.     ENDIF
  833.             END
  834.        ENDIF
  835.     END
  836.  
  837. ERRQUIT:
  838.     i% = DoMsgBox("Setup sources were corrupted, call Microsoft Product Support Services at (206) 454-2030 for assistance.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  839.     END
  840.  
  841. ASKEXIT:
  842.     sz$ = UIStartDlg(CUIDLL$, ASKEXIT, "FQuitDlgProc", 0, "")
  843.  
  844.     IF sz$ = "EXIT" THEN
  845.         UIPopAll
  846.         END '' Exit Setup
  847.     ELSEIF sz$ = "REACTIVATE" THEN
  848.         GOTO ASKEXIT
  849.     ELSE
  850.         UIPop 1
  851.     END IF
  852.     RETURN
  853.  
  854.  
  855. WHAT_IS:
  856.     sz$ = UIStartDlg(CUIDLL$, dlg_WHAT_IS%, "FInfoDlgProc", 0, "")
  857.  
  858.     IF sz$ = "REACTIVATE" THEN
  859.     GOTO WHAT_IS
  860.     END IF
  861.     UIPop 1
  862.     RETURN
  863.  
  864.  
  865.  
  866. '*************************************************************************
  867. '**
  868. '** Install
  869. '** -------
  870. '**
  871. '** Purpose:
  872. '**     Performs all installation operations.
  873. '** Arguments:
  874. '**     none.
  875. '** Returns:
  876. '**     none.
  877. '*************************************************************************
  878. SUB Install STATIC
  879.  
  880.     '' ASSERT DEST$ points to the selected drive to install viewer
  881.     '' ASSERT the copy list has been filled in.
  882.     
  883.      CreateDir DEST$, cmoNone
  884.  
  885.     ''AddBlankToBillboardList 1024
  886.     AddToBillboardList "mscuistf.dll", BLBD_REGISTER, "FModelessDlgProc",2048
  887.     SetCopyGaugePosition 160, 20
  888.  
  889.      ' Install Driver and fix section in system.ini
  890.     '' --------------------------------------------
  891.                                      
  892.     sz$ = GetWindowsDir()
  893.     CreateIniKeyValue sz$+"system.ini", "drivers","wavemapper","msacm.drv", cmoOverwrite
  894.     CreateIniKeyValue sz$+"system.ini", "drivers","qkeys","qkeys.drv", cmoOverwrite
  895.     CreateIniKeyValue WININI$, BOOK_INI$, "TBOX", "1", cmoOverwrite
  896.     
  897.     CreateIniKeyValue WININI$, BOOK_INI$, "TBOX", "1", cmoOverwrite
  898.     CreateIniKeyValue WININI$, "Multimedia Viewer", "M_WindowPosition", "[0,0,640,480,0]" ,cmoNone
  899.     
  900.     ss$=GetIniKeyString(sz$+"system.ini", "boot", "drivers")
  901.     ss$=UCASE$(ss$)
  902.  
  903.     IF Instr(ss$, "QKEYS.DRV")=0 THEN
  904.         CreateIniKeyValue sz$+"system.ini", "boot", "drivers", ss$+" qkeys.drv", cmoOverWrite 
  905.     ENDIF
  906.  
  907.     CopyFilesInCopyList
  908.     InstallFonts
  909.     
  910.     ' Fix the view.ini
  911.     ' ----------------
  912.     ViewerIni$ = MakePath(GetWindowsDir,"Viewer.ini")
  913.     ErrStr$ = "Please insert the " + PROG_GRP$ + " CD."  
  914.     files$ = "Files" 
  915.     
  916.     CreateIniKeyValue ViewerIni$, files$, "Books93.MVB", BookDir$ + "," + ErrStr$, cmoOverwrite
  917.     
  918.     ' Add viewer dll path
  919.     ' -------------------              
  920.     
  921.     winsys$ = GetWindowsSysDir()                 
  922.     CreateIniKeyValue ViewerIni$, files$, "MVTITLE2.DLL", winsys$, cmoOverwrite
  923.     CreateIniKeyValue ViewerIni$, files$, "MVFS2.DLL", winsys$, cmoOverwrite
  924.     CreateIniKeyValue ViewerIni$, files$, "MVSRCH2.DLL", winsys$, cmoOverwrite
  925.     CreateIniKeyValue ViewerIni$, files$, "MVAPI2.DLL", winsys$, cmoOverwrite
  926.     CreateIniKeyValue ViewerIni$, files$, "MVBMP2.DLL", winsys$, cmoOverwrite
  927.     CreateIniKeyValue ViewerIni$, files$, "MVBRKR2.DLL", winsys$, cmoOverwrite
  928.     CreateIniKeyValue ViewerIni$, files$, "MVMCI2.DLL", winsys$, cmoOverwrite
  929.     CreateIniKeyValue ViewerIni$, files$, "MVIEWER2.DLL", winsys$, cmoOverwrite
  930.     CreateIniKeyValue ViewerIni$, files$, "MVAFF.DLL", winsys$, cmoOverwrite
  931.  
  932.     CreateIniKeyValue ViewerIni$, files$, "MVFTSUI2.DLL", winsys$, cmoOverwrite
  933.     CreateIniKeyValue ViewerIni$, files$, "CTL3D.DLL", winsys$, cmoOverwrite
  934.     CreateIniKeyValue ViewerIni$, files$, "MMP.DLL", winsys$, cmoOverwrite
  935.     CreateIniKeyValue ViewerIni$, files$, "BOOKS93.DLL", DEST$, cmoOverwrite
  936.     
  937.     Command$ = GetWindowsSysDir()+"MVIEWER2.EXE "
  938.  
  939.     gr$=GetSymbolValue("groupName")        '' group name was asked in the option dialog
  940.     gr$ = LTRIM$(gr$)
  941.     gr$ = RTRIM$(gr$)
  942.     CreateProgmanGroup gr$, "", cmoOverwrite
  943.     
  944.     '' check for multiple icons for bookshelf 
  945.         sz$ = GetListItem("CheckItemsState", CHECK_QK)
  946.         fMI% = 1            '' multi icon for bookshelf
  947.         IF sz$ = "OFF" THEN
  948.             fMI% = 0
  949.         ENDIF
  950.  
  951.     IF fMI% = 0 THEN
  952.         CreateProgmanItem gr$, "Bookshelf 1993", Command$ + "BOOKS93.MVB", MakePath(DEST$, "Books93.ico"), cmoOverwrite
  953.     ELSE
  954.         ComSwitch$= Command$+"-i"
  955.         theBook$=" books93.mvb" 
  956.         CreateProgmanItem gr$, "Bookshelf 1993", Command$ + "BOOKS93.MVB", MakePath(DEST$, "Books93.ico"), cmoOverwrite
  957.         CreateProgmanItem gr$, "Concise Quotes", ComSwitch$+"CCQ_CONTENTS"+theBook$, MakePath(DEST$, "cquote93.ico"), cmoOverwrite
  958.         CreateProgmanItem gr$, "Bartlett's", ComSwitch+"BFQ_CONTENTS"+theBook$, MakePath(DEST$, "bquote93.ico"), cmoOverwrite
  959.         CreateProgmanItem gr$, "Encyclopedia", ComSwitch$ + "CCE_CONTENTS"+theBook$, MakePath(DEST$, "encyc93.ico"), cmoOverwrite
  960.         CreateProgmanItem gr$, "Dictionary", ComSwitch$ + "AHD_CONTENTS"+theBook$, MakePath(DEST$, "dict93.ico"), cmoOverwrite
  961.         CreateProgmanItem gr$, "Thesaurus", ComSwitch$ + "RET_CONTENTS"+theBook$, MakePath(DEST$, "roget93.ico"), cmoOverwrite
  962.         CreateProgmanItem gr$, "Atlas", ComSwitch$ + "HAM_CONTENTS"+theBook$, MakePath(DEST$, "atlas93.ico"), cmoOverwrite
  963.         CreateProgmanItem gr$, "1993 Almanac", ComSwitch$+ "WA_CONTENTS"+theBook$, MakePath(DEST$, "alman93.ico"), cmoOverwrite    
  964.     ENDIF    
  965.     CreateProgmanItem gr$, "Bookshelf 1993 ReadMe", "Notepad.exe " + MakePath( SRCDIR$, "readme.txt"),"", cmoOverwrite
  966.     CreateProgmanItem gr$, "Bookshelf 1993 Support", "Notepad.exe " + MakePath( SRCDIR$, "finfaq.txt"),"", cmoOverwrite
  967.     CreateProgmanItem gr$, "Bookshelf 1993 Overview", "winhelp.exe " + "-imenuHelpDemo " + MakePath( SRCDIR$, "books\bks93.hlp" ), MakePath(DEST$, "bsover.ico") , cmoOverwrite
  968.     ShowProgmanGroup  gr$, 1, cmoNone
  969.  
  970. END SUB
  971.  
  972.  
  973.  '*************************************************************************
  974. '**
  975. '** InstallWinWord
  976. '** -----------------
  977. '**
  978. '** Purpose:
  979. '**    Install special WinWord Integration files
  980. '** Arguments:
  981. '**     none.
  982. '** Returns:
  983. '**     none.
  984. '** Comments:
  985. '**
  986. '*************************************************************************
  987. SUB InstallWinWord STATIC
  988.  
  989. '** Obtain INI settings
  990.  
  991.     ' ASSERT: Word 2.0 section exists in the INI file
  992.     ' ASSERT: WordDir$ = valid path to winword.exe
  993.     DotPath$ = GetIniKeyString(WININI$, WORD_INI$, "DOT-PATH")
  994.     IF DotPath$ = "" THEN
  995.         DotPath$ = WordDir$
  996.         CreateIniKeyValue WININI$, WORD_INI$, "DOT-PATH", WordDir, cmoOverwrite
  997.     ENDIF
  998.  
  999.     IF (DoesFileExist(MakePath(DotPath$,"NORMAL.DOT"), femExists) = 1) AND (DoesFileExist(MakePath(DotPath$,"NORMAL.WAB"), femExists) = 0) THEN
  1000.         CopyFile MakePath(DotPath$,"NORMAL.DOT"), MakePath(DotPath$,"NORMAL.WAB"), cmoNone, 0
  1001.     ENDIF
  1002.  
  1003.     '' Make a backup of toolbar bitmap.  May be making a backup of
  1004.     ''  a file just created from copylist.
  1005.     '' ASSERT: The toolbar bitmaps exist because they were in the copy list.
  1006.     IF DoesFileExist(MakePath(DotPath$,"V2TBAR.WAB"), femExists) = 0 THEN
  1007.         CopyFile MakePath(DotPath$,"V2TBAR.BMP"), MakePath(DotPath$,"V2TBAR.WAB"), cmoNone, 0
  1008.     ENDIF
  1009.     i% = IReplaceTbarBmpsIfDifferent(MakePath(SRCDIR$,"VIEWER\BS93WORD\V2TBAR.BMP"), MakePath(DotPath$,"V2TBAR.BMP"), 25)
  1010.  
  1011.     IF DoesFileExist(MakePath(DotPath$,"82TBAR.WAB"), femExists) = 0 THEN
  1012.         CopyFile MakePath(DotPath$,"82TBAR.BMP"), MakePath(DotPath$,"82TBAR.WAB"), cmoNone, 0
  1013.     ENDIF
  1014.     i% = IReplaceTbarBmpsIfDifferent(MakePath(SRCDIR$,"VIEWER\BS93WORD\82TBAR.BMP"), MakePath(DotPath$,"82TBAR.BMP"), 25)
  1015.  
  1016.  
  1017. '** set INI file settings
  1018.         CreateIniKeyValue WININI$, WORD_INI$, "LoadToolbarBitmaps", "Yes", cmoOverwrite
  1019.         CreateIniKeyValue WININI$, BOOK_INI$, "SendToDlg", "1", cmoOverwrite
  1020.         CreateIniKeyValue WININI$, BOOK_INI$, "HelpFile",  MakePath( SRCDIR$,  "word\winword.hlp"), cmoOverwrite
  1021.         CreateIniKeyValue WININI$, BOOK_INI$, "Integration", "2", cmoOverwrite
  1022.         CreateIniKeyValue WININI$, BOOK_INI$, "ViewerPath", MakePath(GetWindowsSysDir(), "MViewer2"), cmoOverwrite
  1023.         CreateIniKeyValue WININI$, BOOK_INI$, "BooksPath",   MakePath( SRCDIR$,  "books\"), cmoOverwrite
  1024.  
  1025. '** add macros to NORMAL.DOT (bookshlf.dot must have been copied to progdir)
  1026.  
  1027.     '' disable quote of the day
  1028.     CreateIniKeyValue WININI$, BOOK_INI$, "LastQuote",   "0", cmoOverwrite
  1029.     cmd$ = MakePath(WordDir$,"winword.exe" ) + " " + MakePath(WordDir$, "bshelf93.dot") + " /mwabSetup"
  1030.     ignore% =  WinExec(cmd$,SW_SHOWMINIMIZED)
  1031.     '' enable quote of the day
  1032.     CreateIniKeyValue WININI$, BOOK_INI$, "LastQuote",   "1", cmoOverwrite
  1033.  
  1034.     
  1035. END SUB
  1036.  
  1037. '*************************************************************************
  1038. '**
  1039. '** InstallFonts
  1040. '** ------------
  1041. '**
  1042. '** Purpose:
  1043. '**    Install special Screen (raster) fonts
  1044. '** Arguments:
  1045. '**     none.
  1046. '** Returns:
  1047. '**     none.
  1048. '** Comments:
  1049. '**    ensure that the font files are copied
  1050. '**    !!CAUTION!! at present, this only installs VGA fonts !!!
  1051. '*************************************************************************
  1052. SUB InstallFonts STATIC
  1053.  
  1054.     szKey$ = "Lucida Sans B 10,12,14"    
  1055.     CreateIniKeyValue WININI$, "fonts", szKey$, "VGALSB.FON", cmoOverwrite
  1056.     szKey$ = "Lucida Sans B1 10,12,14"    
  1057.     CreateIniKeyValue WININI$, "fonts", szKey$, "VGALSB1.FON", cmoOverwrite
  1058.     szKey$ = "Lucida Sans B2 10,12,14"    
  1059.     CreateIniKeyValue WININI$, "fonts", szKey$, "VGALSB2.FON", cmoOverwrite
  1060.     szKey$ = "Symbol B"    
  1061.     CreateIniKeyValue WININI$, "fonts", szKey$, "VGASB.FON", cmoOverwrite
  1062.  
  1063.     ignore% = AddFontResource(MakePath$(GetWindowsSysDir$, "VGALSB.fon"))
  1064.     ignore% = AddFontResource(MakePath$(GetWindowsSysDir$, "VGALSB1.fon"))
  1065.     ignore% = AddFontResource(MakePath$(GetWindowsSysDir$, "VGALSB2.fon"))
  1066.     ignore% = AddFontResource(MakePath$(GetWindowsSysDir$, "VGASB.fon"))
  1067.  
  1068.     
  1069.     '' make sure windows sees the font addition to WIN.INI
  1070.     ignore% = SendMessage (-1, WM_WININICHANGED, 0, "fonts")
  1071.     ignore% = SendMessage (-1, WM_FONTCHANGE, 0, "")
  1072. END SUB
  1073.                       
  1074.  
  1075.  
  1076. '*************************************************************************
  1077. '**
  1078. '** MakePath
  1079. '** --------
  1080. '** Purpose:
  1081. '**     Appends a file name to the end of a directory path,
  1082. '**     inserting a backslash character as needed.
  1083. '** Arguments:
  1084. '**     szDir$  - full directory path (with optional ending "\")
  1085. '**     szFile$ - filename to append to directory
  1086. '** Returns:
  1087. '**     Resulting fully qualified path name.
  1088. '*************************************************************************
  1089. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  1090.     IF szDir$ = "" THEN
  1091.         MakePath = szFile$
  1092.     ELSEIF szFile$ = "" THEN
  1093.         MakePath = szDir$
  1094.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  1095.         MakePath = szDir$ + szFile$
  1096.     ELSE
  1097.         MakePath = szDir$ + "\" + szFile$
  1098.     END IF
  1099. END FUNCTION
  1100.